USE [AuctionDB]
GO

ALTER TABLE [dbo].[BidList] DROP CONSTRAINT [FK_BidList_User]
GO

ALTER TABLE [dbo].[BidList] DROP CONSTRAINT [FK_BidList_Auction]
GO

/****** Object:  Table [dbo].[BidList]    Script Date: 7/18/2013 1:05:17 PM ******/
DROP TABLE [dbo].[BidList]
GO

/****** Object:  Table [dbo].[BidList]    Script Date: 7/18/2013 1:05:17 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[BidList](
	[BidID] [int] IDENTITY(1,1) NOT NULL,
	[AuctionID] [int] NOT NULL,
	[BidderID] [int] NOT NULL,
	[PlacedPrice] [float] NOT NULL,
	[State] [varchar](10) NOT NULL,
 CONSTRAINT [PK_BidList] PRIMARY KEY CLUSTERED 
(
	[BidID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[BidList]  WITH CHECK ADD  CONSTRAINT [FK_BidList_Auction] FOREIGN KEY([AuctionID])
REFERENCES [dbo].[Auction] ([AuctionID])
GO

ALTER TABLE [dbo].[BidList] CHECK CONSTRAINT [FK_BidList_Auction]
GO

ALTER TABLE [dbo].[BidList]  WITH CHECK ADD  CONSTRAINT [FK_BidList_User] FOREIGN KEY([BidderID])
REFERENCES [dbo].[User] ([UserID])
GO

ALTER TABLE [dbo].[BidList] CHECK CONSTRAINT [FK_BidList_User]
GO

